<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Subject')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-subject" class="form-control selectpicker" name="row[subject]">
                {foreach name="subjectList" item="vo"}
                <option value="{$key}" {in name="key" value="1" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                <option value="1" {in name="key" value="1" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_id" min="0" data-rule="required" data-source="course/category/index"
                data-field='title' class="form-control selectpage" name="row[category_id]" type="text" value="">

        </div>
    </div> -->

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" name="row[title]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload"
                            data-input-id="c-image"
                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                            data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i>
                            {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose"
                            data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i
                                class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" class="form-control " rows="5" name="row[content]"
                cols="50"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Class')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[class]-1"><input id="row[class]-1" name="row[class]" type="radio" value="1" {in
                        name="key" value="1" }checked{/in} /> {:__('Class 1')}</label>
                <label for="row[class]-2"><input id="row[class]-2" name="row[class]" type="radio" value="2" {in
                        name="key" value="2" }checked{/in} /> {:__('Class 2')}</label>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Options')}:</label>
        <div class="col-xs-12 col-sm-8">

            <table class="table fieldlist" data-name="row[options]" data-template="row[options]tpl">
                <tr>
                    <td>{:__('options answer')}</td>
                    <td>{:__('options correct')}</td>
                    <td width="90">{:__('Operate')}</td>
                </tr>
                <tr>
                    <td colspan="3">
                        <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>
                            {:__('Append')}</a>
                        <textarea name="row[options]" class="form-control hide" cols="30" rows="5"></textarea>
                    </td>
                </tr>
            </table>
            <script type="text/html" id="row[options]tpl">
                <tr>
                    <td><input type="text" name="<%=name%>[<%=index%>][answer]" class="form-control" value="<%=row.answer%>"/></td>
                    <td>
                        <!-- <input type="text" name="<%=name%>[<%=index%>][correct]" class="form-control" value="<%=row.correct%>"/> -->
                        <input  id="c-switch-<%=index%>" name="<%=name%>[<%=index%>][correct]" type="hidden" value="0">
                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch-<%=index%>" data-yes="1" data-no="0" >
                        <i class="fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x"></i>
                        </a>
                    </td>
                    <td width="90">
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>